﻿using Microsoft.Win32;
using System.Windows;

namespace Validator.Views
{
    public partial class Window1 : Window
    {
        public string UserName { get; private set; }
        public Window1()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Do you want to continue?", "confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);
            if (result == MessageBoxResult.Yes)
            {
                //MessageBox.Show("1");
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.Filter = "C:\\九合一(*.xlsx)|*.xlsx|All Files(*.*)|*.*";
                if (openFileDialog.ShowDialog() == true)
                {
                    string filePath = openFileDialog.FileName;
                }
            }
            else
            {
                //MessageBox.Show("2");
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.Filter = "D:\\test\\(*.xlsx)|*.xlsx|All Files(*.*)|*.*";
                if (saveFileDialog.ShowDialog() == true)
                {
                    string filePath = saveFileDialog.FileName;
                }
            }
        }


    }
}
/// <summary>
/// Window1.xaml 的交互逻辑
/// </summary>
/*public partial class Window1 : Window
{
    public UserControl CurrentPage
    {
        get => (UserControl)GetValue(CurrentPageProperty);
        set=>SetValue(CurrentPageProperty, value);
    }
    public static readonly DependencyProperty CurrentPageProperty =DependencyProperty.Register("CurrentPage",typeof(UserControl),typeof(MainWindow),new PropertyMetadata(null));
    private Page1 page1;
    private Page2 page2;
    public Window1()
    {
        InitializeComponent();
        page1 = new Page1();
        page2 = new Page2();
        CurrentPage = page1;
    }
    private void SwitchToPage1()
    {
        CurrentPage = page1;
    }
    private void SwitchToPage2() 
    {
        CurrentPage = page2;
    }
    private void Button_Click(object sender, RoutedEventArgs e)
    {

    }
}
}*/
